package StringTest.noForString;

import java.util.ArrayList;
import java.util.List;

/**
 * 无意识的递归
 */
public class noForString {

    public static void main(String[] args) {

        List<Coffee> coffees=new ArrayList<Coffee>();

        for (Coffee coffee : CoffeeGenerator(10)) {
            coffees.add(coffee);
        }
        System.out.println(coffees);

    }

    private static List<Coffee>  CoffeeGenerator(int number){

        List<Coffee> coffees=new ArrayList<Coffee>();
        for (int i = 0; i < number; i++) {
            Coffee coffee = new Coffee();
            coffee.setName("tom"+i);
            coffee.setNumber(i);
            coffees.add(coffee);
        }
        return coffees;
    }
}
